//
//  XFYLocalData.h
//  SDKSample
//
//  Created by 小肥羊 on 15/6/3.
//  Copyright (c) 2015年 Zhu‘s Game House. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "FMDatabase.h"

#define DATABASE_PATH [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES)[0]stringByAppendingString:@"/SampleData.db"]

@interface XFYLocalData : NSObject

@property (nonatomic,strong) FMDatabase *db;

+ (XFYLocalData *)sharedManager;

+ (BOOL)openDB;
+ (BOOL)closeDB;

#pragma mark - 数据操作
/*! @brief 添加碎片数据 */
- (BOOL)addFragmentData:(NSString *)fragmentData;
/*! @brief 修改碎片数据 */
- (BOOL)modifyFragmentData:(NSString *)oldData fragmentData:(NSString *)newData;
/*! @brief 删除碎片数据 */
- (BOOL)deleteFragmentData:(NSString *)data;
/*! @brief 查找碎片数据 */
- (FMResultSet *)searchAllFragmentData;

@end
